<?php
if (isset($_GET['image'])) {
    sleep(1);
    header('Location: image/'.$_GET['image'].".jpg");
    exit();
}
if (isset($_GET['product_id'])) {
    $id = $_GET['product_id'];
    $list = array();
    for($i = 0; $i < 10; $i++){
        $list[] = array(
            "name" => "head ".$i,
            "description" => "text ".$i,
            "value"=>round(rand()*10)
        );
    }
    echo json_encode(array(
        "name" => "Header ".$id,
        "description" => "Description ".$id,
        "price" => round(rand()*10),
        "image" =>array("get_data.php?image=1","get_data.php?image=2","get_data.php?image=3","get_data.php?image=4","get_data.php?image=5","get_data.php?image=6"),
        "items" => $list
    ));
    exit;
}
if (isset($_GET['info'])) {
    $info = $_GET['info'];
    $list = array();
    for($i = 0; $i < 10; $i++){
        $list[] = array(
            "name" => "head ".$i,
            "description" => "text ".$i,
            "value"=>round(rand()*10)
        );
    }
    echo json_encode(array(
        "name" => "Header ".$info,
        "description" => "Description ".$info,
        "items" => $list
    ));
    exit;
}
//
$start = 0;
if (isset($_GET['start'])) $start = $_GET['start'];
$list = array();
for($i = $start; $i < $start +10; $i++){
    $list[] = array(
        "name" => "Header ".$i,
        "description" => "Description ".$i,
        "id"=>$i
    );
}
sleep(1);
echo json_encode($list);
?>
